<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    {{msg}}
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#app',
      data: {
        msg: 'hi vue'
      },
      // 侦听器
      watch: {
        msg (newVal, oldVal) {
          console.log(newVal, oldVal)
        }
      }
    })
  </script>
</body>
</html>